<?php
/**
 * Created by PhpStorm.
 * User: JACK.L
 * Date: 2018/6/8
 * Time: 17:49
 */

namespace app\index\validate;

use think\Validate;

class Vehicle extends Validate
{
    protected $rule =   [
        'warehouse'  => 'require',
        'vehicle_id'   => 'require',
        'name' => 'require',
        'depot'=>'require',
        'max_weight'=>'require|number',
        'max_stops'=>'require|number',
        'is_cold_storage'=>'require',
        'status'=>'require'
    ];

    protected $message  =   [
        'warehouse.require' => 'WareHouse 必须填写',
        'vehicle_id.require'     => 'vehicle_id ID必须填写',
        'name.require'   => 'Name必须填写',
        'depot.require'  => 'Depot必须填写',
        'max_weight.require'        => 'Max Weight 必须填写',
        'max_stops.require'        => 'Max Stops 必须填写',
        'max_weight.number'        => 'Max Weight 必须是数字',
        'max_stops.number'        => 'Max Stops 必须数字',
        'is_cold_storage.require'        => 'is_cold_storage 必须填写',
        'status.require'        => 'status 必须填写'
    ];
    protected $scene = [
        'edit'  =>  [  'warehouse','name' ,'depot','max_weight','max_stops','is_cold_storage']
    ];

}